I'm writing a sorted vector implementation and trying to do it as simply as possible.
Right now, I'm declaring the sorted vector with a protected subclass of vector, then using the "using" keyword to explicitly inherit all methods that aren't related to adding new elements to the vector (so I can control the order).
Eg:Obviously, this is annoyingly redundant. So what I'd like to do is something using the new "delete" keyword from C++11. Is there any quick, expressive way of deleting specific methods?Code:template<typename T, class Cmp = std::less<T>> class sorted_vector : protected std::vector<T>{ public: typedef typename std::vector<T>::iterator; using std::vector<T>::operator=; using std::vector<T>::assign; using std::vector<T>::get_allocator; using std::vector<T>::at; using std::vector<T>::operator[]; //... };
Also, it's pretty annoying to have to
typedef base_class::type type
to inherit a type from a base class. Is there a shorter way to do that?